﻿#define _CRT_SECURE_NO_WARNINGS//实现一个对整形数组的冒泡排序
#include<stdio.h>
int main()
{
	int t = 0;
	int	a[] = { 2,7,3,5,8,1,4,6 };
	int m = sizeof(a) / sizeof(a[0]);
	for (int n = 0; n < m; n++)
		printf("%d ", a[n]);
	printf("\n");
	for (int i = 0; i < m - 1; i++)
	{
		for (int j = 0; j < m - 1 - i; j++)
		{
			if (a[j] > a[j + 1])
			{
				t = a[j];
				a[j] = a[j + 1];
				a[j + 1] = t;
			}
		}
	}
	for (int n = 0; n < m; n++)
		printf("%d ", a[n]);
	return 0;
}